package com.shangxia.user.controller;

import com.shangxia.feign.model.SX_User;
import com.shangxia.user.config.Content;
import com.shangxia.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhouya38158
 * @Package com.example.user.controller
 * @date 2021/11/2 14:46
 */
@Slf4j
@RestController
@RequestMapping("/user")
@Api("user")
public class UserController {

    @Autowired
    private UserService userService;

    @Autowired
    private Content content;

    @GetMapping("/{id}")
    @ApiOperation(notes = "user", value = "获取用户")
    public SX_User queryById(@PathVariable("id") Long id) {
        System.out.println("pattern.dateformat=" + content.getPartten());
        return userService.queryById(id);
    }

}
